<?php

class UrlManager extends CUrlManager
{

	public function createUrl($route, $params=array(), $ampersand='&')
	{
//		exit;
		$lang = null;
		if(!empty($params['lang']))
		{
			$lang = $params['lang'];
			unset($params['lang']);
		}

		$url = parent::createUrl($route, $params, $ampersand);

		$url = DMultilangHelper::addLangToUrl($url, $lang);

		return $url;
	}

	public function createAbsoluteUrl($route, $params=array(), $ampersand='&')
	{
		exit;
		$lang = null;
		if(!empty($params['lang']))
		{
			$lang = $params['lang'];
			unset($params['lang']);
		}

		$url = parent::createUrl($route, $params, $ampersand);

		$url = DMultilangHelper::addLangToUrl($url, $lang);

		return $url;
	}

}